<template>
	<view>
		<u-cell-group v-if="data.length > 0">
			<u-cell v-for="(item,index) in data" :key="index" :title="item.name" isLink @click="policy(item.id)">
				<u-icon slot="icon" size="30" color="#a0cfff" name="coupon"></u-icon>
			</u-cell>
		</u-cell-group>
		<u-empty v-else mode="list" icon="/static/Empty/data_null.png">
		</u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: []
			}
		},
		onLoad() {
			this._request()

		},
		methods: {
			async _request() {
				const userinfo = uni.getStorageSync('userinfo');
				const {
					data: res
				} = await this.$myHttp5({
					url: 'Setting/getProductAllocationCount',
					header: {
						'token': userinfo.token
					},
				});
				if (res.code == 1) {
					this.data = res.data
				} else {
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 3000
					})
				}
			},
			policy(id) {
				uni.navigateTo({
					url: '/pages/version5/index/standard/lists?id=' + id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.u-slot-value {
		color: red;
	}
</style>